<script type="text/javascript">
var successFun=function(res){
if(res.code==200){
	document.location.reload();
}else{
	alert('出错了，请重新尝试！');
}
}
$(document).ready(function() { 
	var updateOptions	= {dataType:'json',error:doError,success:doSuccess}
    $('#form').ajaxForm(updateOptions);
}); 
</script>
<div id="content">
<div id="box">
<script src="{$this->data['baseurl']}js/checkbox.js"></script>
<form id="form" method="post" action="{url('Post','SaveAll')}">
<h3 class="title">{if $this->data['type']=='comment'}评论{else}帖子{/if}管理</h3>
<table class="admin-table">
<thead>
	<tr>
    	<th class="a-center"><a href="javascript:reverseCheckByName('id[]','post')">ID</a></th>
    	<th class="a-center">类别</th>
        <th class="a-center">{if $this->data['type']=='comment'}评论{else}标题{/if}</th>
        <th class="a-center">状态</th>
        <th class="a-center">更新时间</th>
    	<th class="a-center">操作</th>
    </tr>
</thead>
<tbody>
	{if !empty($this->data['data']['rows'])}
	<!--{loop $this->data['data']['rows'] $info}-->
	<tr>
    	<td class="a-center"><input type="checkbox" name="id[]" option='post' value="{$info['id']}" />{$info['id']}</td>
    	<td class="a-center">{$this->data['types'][$info['type']]}</td>
        <td class="a-center">{if $this->data['type']=='comment'}{strip_tags($info['content']['content'])}{else}<a href="{url('Post','Edit',array('id'=>$info['id']))}">{$info['title']}</a>{/if}</td>
        <td class="a-center">{if $info['status']==0}未审核&nbsp;{/if}{if $info['suggest']==1}置顶&nbsp;{/if}</td>
        <td class="a-center">{$info['modified']}</td>
        <td class="a-center">{if $this->data['type']!='comment'}<a href="{url('ProductRelated','Edit',array('iid'=>$info['id'],'type'=>1))}">关联商品</a> | <a href="{url('Post','Edit',array('id'=>$info['id']))}">编辑</a> | {/if}<a href="{url('Post','Del',array('id'=>$info['id']))}" onclick="return confirm('确定要删除么？');">删除</a></td>
    </tr>
    <!--{/loop}-->
    <tr>
    <td colspan="6">
    <input type="radio" name="op" value="del">删除
	<input type="radio" name="op" value="admit">审核通过
	<input type="radio" name="op" value="unadmit">取消审核通过
	{if $this->data['type']!='comment'}
	<input type="radio" name="op" value="recommend">设置置顶
	<input type="radio" name="op" value="unrecommend">取消置顶
	{/if}
    <input type="submit" value="执行"  onclick="return confirm('您确定执行的操作吗?');">
    </td>
    </tr>
    {/if}
</tbody>
</table>
<div id="pager">
{$this->data['pages']}
</div>
</form>
</div>
</div>